package com.share.collection;


import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

public class ComparableDemo {

	public static void main(String[] args) {

		List<Name2> l1 = new LinkedList<Name2>();
		l1.add(new Name2("Nsds", "Mm"));
		l1.add(new Name2("Steven", "Zhang"));
		l1.add(new Name2("Tgdf", "J"));
		l1.add(new Name2("Tom", "S"));
		System.out.println(l1);
		
		Collections.sort(l1);
		System.out.println(l1);

	}
}
